/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.awt.Component;
import java.util.List;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author Ira
 */
public class AuthorsCellRenderer extends DefaultTableCellRenderer {
	@Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

		List<String> l = (List<String>)value;
		String val = "";
		for(int i=0, size=l.size(); i<size; ++i) {
			val += l.get(i);
			if(i!=size-1) {
				val += "; ";
			}
		}
		this.setText(val);
		
        return this;
    }
}
